<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>$title</title>
    <base href="$_G['siteurl']" />
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="static/bootstrap3.3.0/css/bootstrap.min.css">
    <!-- 可选的Bootstrap主题文件（一般不用引入） -->
    <link rel="stylesheet" href="static/bootstrap3.3.0/css/bootstrap-theme.min.css">
    <script src="static/js/jquery-1.12.4.min.js"></script>
    <script src="static/js/sea.js" type="text/javascript"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="static/bootstrap3.3.0/js/bootstrap.min.js"></script>

    <script src="static/jquery-jsonview-master/dist/jquery.jsonview.min.js"></script>
    <link href="static/jquery-jsonview-master/dist/jquery.jsonview.min.css" rel="stylesheet" >
   <script type="text/javascript">

      jQuery(function($) {
        $(".websockettype").each(function (index, domEle) {
         var wscode = $(this).find('.websockettypecode textarea').val();
          wscodeobj = JSON.parse(wscode);
         $(this).find('.websockettypecodedisplay .showcode').JSONView(wscodeobj);
        });
      });



	function fastview(url,_this){
		
		seajs.use(['/static/artDialog/src/dialog'], function (dialog) {
			var d = dialog({
			    content: 'loading..',
			    width: 600,
				height: 80,
				padding: 10,
				quickClose: true,
			    onshow: function () {
			    	var _dthis = this;
			    	$.getJSON(url+'&inajax=1', function(content){
			    		_dthis.content(content);
			    		_dthis.height($('.responsecontent').height());
			    		console.log($('.responsecontent').height());
						_dthis.reset();  
			    	});
			    }
			}).show(_this);
		});


/*		
			seajs.use(['/static/artDialog/src/dialog'], function (dialog) {
				choicedialog = dialog({ 
					content: content,
					width: 600,
					height: 80
				}).show(_this);
			});

		});*/
	}


      function displayws(_this){
          $(_this).parents('.websockettype').find('.websockettypecodedisplay').toggle();
      }



      </script>
         <style type="text/css">
        .tablefont{
          font-family: Georgia,Verdana;
        }
    .tabletitle {
       font-weight: 700
    }
      </style>
  </head>
  <body>




  <div class="container-fluid">
  <p>
      <!--{loop $websockettype $wskey $wstype}-->
        <div class="list-group websockettype">
          <li  class="list-group-item disabled"><b>$wskey</b> $wstype[title]</li>

          <li  class="list-group-item">

            <table class="table table-bordered table-striped table-info list-group-item-info tablefont">

              <tbody>
                <tr><td  colspan="2" valign="middle">● $wskey</td></tr>
                <tr><td width="20%">参数</td><td width="80%">说明</td></tr>
                <!--{loop $wstype[data] $key $value}-->
                  <tr>
                    <td><!--{if isset($response[$key])}--><a href="javascript:;" onclick="fastview('wiki/response?display=$key',this)" target="_blank">$key</a> <a href="wiki/response?display=$key" target="_blank"><img src="static/image/linktarget.png"></a><!--{else}-->$key<!--{/if}--></td>
                    <td>$value 
                    <!--{if $wskey=='message' &&$key == 'status'}-->
                <a href="javascript:;" onclick="fastview('wiki/error?displaytype=msgerror',this,500)" target="_blank">当前接口返回错误码</a> <a href="wiki/error?displaytype=msgerror" target="_blank"><img src="static/image/linktarget.png"></a>
                <!--{/if}-->

                    </td>
                  </tr>
                 <!--{/loop}-->
                </tbody>

              </table>
          </li>
          <li class="websockettypecode list-group-item list-group-item-warning"> <textarea style="margin: 0px; width: 100%; height: 50px;resize: vertical;" >$wstype[code]</textarea>
          <button onclick="displayws(this)">查看格式化信息</button>
          </li>
          <li  style="display:none" class="websockettypecodedisplay list-group-item list-group-item-warning "><div class="showcode"></div></li>
          
        </div>
      <!--{/loop}-->
    </p>
  </div>



  </body>
</html>
